<?php $this->load->helper('HTML');
echo link_tag('css/style2.css');
echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?></head>
<div id="wrapper">
	<?php $this->load->view('admin_views/header'); ?><hr />
    <script type="text/javascript">
            //for unit
            $(document).ready( function() {
                $("#intid_unit").autocomplete({
                    minLength: 2,
                    source:
                        function(req, add){
                        $.ajax({
                            url: "<?php echo base_url(); ?>penjualan/lookupUnit",
                            dataType: 'json',
                            type: 'POST',
                            data: req,
                            success:
                                function(data){
                                if(data.response =="true"){
                                    add(data.message);
                                }
                            },
                        });
                    },
                    select:
                        function(event, ui) {
                        $("#result").append(
                        "<input type='hidden' id='id_unit' name='id_unit' value='" + ui.item.id + "' size='10' />"
                    );
                    },
                });

				$("#strnama_dealer").autocomplete({
                    minLength: 2,
                    source:
                        function(req, add){
                        $.ajax({
                            url: "<?php echo base_url(); ?>penjualan/lookupUpline",
                            dataType: 'json',
                            type: 'POST',
                            data: {
                                term: req.term,
                                state: $('#id_unit').val(),

                            },
                            success:
                                function(data){
                                if(data.response =="true"){
                                    add(data.message);
                                }
                            },
                        });
                    },
                    select:
                        function(event, ui) {
                        $("#result").append(
                        "<input type='hidden' align='top' id='strkode_dealer' name='strkode_dealer' value='" + ui.item.id + "'/>"
                    );
                    },
                });

                	$("#id_cabang").autocomplete({
      			minLength: 2,
      			source:
        		function(req, add){
          			$.ajax({
		        		url: "<?php echo base_url(); ?>penjualan/lookup",
		          		dataType: 'json',
		          		type: 'POST',
		          		data: req,
		          		success:
		            	function(data){
		              		if(data.response =="true"){
		                 		add(data.message);
		              		}
		            	},
              		});
         		},
         	select:
         		function(event, ui) {
            		$("#result3").append(
            			"<input type='hidden' id='intid_cabang' name='intid_cabang' value='" + ui.item.id + "' size='30' />"
            		);
         		},
    		});
	});
	</script>
</div>

	<div id="page">
	<div id="page-bgtop">
		<div id="content">
        <div class="post">
          <fieldset>
		<legend><strong>CETAK LAPORAN FEE</strong></legend>
        <form action="<?php echo base_url()?>laporan/fee" method="post" target="_blank">
 		<table width="95%" border="0" cellpadding="0" cellspacing="0" id="data" align="center">
            <tr>
            <td>&nbsp;PERIODE</td>
            <td><!--<input type="text" name="tglstart" id="demo2" maxlength="25" size="25" class="text_box" />
          <a href="javascript:NewCssCal('demo2','yyyymmdd')"> <img src="<?php echo base_url();?>images/cal.gif" width="16" height="16" alt="Pick a date" /></a>&nbsp;&nbsp;TO&nbsp;&nbsp;<input type="text" name="tglend" id="demo3" size="25" /><a href="javascript:NewCssCal('demo3','yyyymmdd')"> <img src="<?php echo base_url();?>images/cal.gif" width="16" height="16" alt="Pick a date" /></a>
                -->
                <select name="month">
                  <option value="">-- Pilih --</option>
                  <option value="01">JANUARI</option>
                  <option value="02">FEBRUARI</option>
                  <option value="03">MARET</option>
                  <option value="04">APRIL</option>
                  <option value="05">MEI</option>
                  <option value="06">JUNI</option>
                  <option value="07">JULI</option>
                  <option value="08">AGUSTUS</option>
                  <option value="09">SEPTEMBER</option>
                  <option value="10">OKTOBER</option>
                  <option value="11">NOVEMBER</option>
                  <option value="12">DESEMBER</option>   
                </select><div id="result3"></div>
                </td>
          </tr>
         <tr>
            	<td>&nbsp;CABANG : </td>
                <?php if ($id_cabang ==1) {?>
                <td><input type="text" name="id_cabang" id="id_cabang"/></td>
                <td>&nbsp;<div id="result3"></div></td>
				<? } else { ?>
                <td><input type="text" name="cabang" id="cabang" value="<?php echo $cabang;?>"/>
                </td>
                <td>&nbsp;</td>
                 <input type="hidden" name="intid_cabang" id="intid_cabang" value="<?php echo $id_cabang;?>" readonly="readonly"/>
                <? } ?>
               
            </tr>
          <tr>
        		<td>&nbsp;UNIT : </td>
        		<td><input type="text" name="nama_unit" id="intid_unit" /><div id="result"></div></td>
     	 	</tr>
            <tr>
        		<td>&nbsp;NAMA DEALER : </td>
        		<td><input type="text" name="strnama_dealer" id="strnama_dealer"/></td>
     	 	</tr>
            
            <tr>
           		<th></th>
            	<td><input type="submit" value="Cetak" class="button" id="submit"/>
        			 &nbsp;
              		<input class="button" type="button" value="Cancel" onclick="location.href='index';"/>                </td>
           </tr>
		</table>
        </form>
        </fieldset>
         </div>
			</div>

		</div>
		<!-- end #content -->
		<?php $this->load->view('admin_views/sidebar_laporan'); ?><!-- end #sidebar -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	<!-- end #page -->
	<div id="footer-bgcontent">
	<?php $this->load->view('admin_views/footer'); ?></div>
	<!-- end #footer -->

